package mark.tom.pistols.encryptor;

import java.util.HashMap;
import java.util.Map;

import mark.tom.pistols.encryptor.ciphers.AESDataEncrypt;
import mark.tom.pistols.encryptor.ciphers.DESDataEncrypt;
import mark.tom.pistols.encryptor.ciphers.RSADataEncrypt;

/**
 * @Description: 数据加密方法工厂
 * @Author: ttmk110@163.com
 * @Package: mark.tom.pistols.encryptor
 * @Date: 2020/7/11
 * @Copyright: 版权归 Mark 所有
 * <ModifyLog>
 * @ModifyContent:
 * @Author:
 * @Date: </ModifyLog>
 */
public class DataEncryptFactory {

   private static Map<String, DataEncrypt> dataEncryptMap = new HashMap<String, DataEncrypt>();

    static {
        dataEncryptMap.put("RSA", new RSADataEncrypt());
        dataEncryptMap.put("DES", new DESDataEncrypt());
        dataEncryptMap.put("AES", new AESDataEncrypt());
    }

    public static DataEncrypt getDataEncryptByCipher(String cipher) {
        return dataEncryptMap.get(cipher);
    }

}
